<template>
  <div class="box">
    <div>账号: <input v-model="username" type="text"> </div>
    <div>密码: <input v-model="password" type="password"> </div>
    <div> <button @click="submit">获取数据</button> <button @click="reset">重置数据</button> </div>
  </div>
</template>

<script>
export default {
  name: 'BaseForm',
  data() {
    return {
      username: '',
      password: ''
    }
  },
  methods: {
    submit() {
      console.log(this.username, this.password)
    },
    reset() {
      this.username = ''
      this.password = ''
    }
  }
}
</script>

<style>
.box {
  width: 500px;
  margin: 0 auto;
  padding: 20px;
  border: 1px solid #ccc;
}
</style>
